package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.CustomCarConfigureDetailModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by yitianle on 2017/8/15.
 */
public interface ICustomCarConfigureDetailJpaRepository extends JpaRepository<CustomCarConfigureDetailModel, Integer> {

    @Query("SELECT a FROM  CustomCarConfigureDetailModel a  where a.id=?1")
    CustomCarConfigureDetailModel getCustomCarConfigureDetailModelById(Integer id);


    @Query("SELECT a FROM  CustomCarConfigureDetailModel a  where a.boutiqueId=?1 and a.storeId=?2")
    CustomCarConfigureDetailModel findByStockIdAndBoutiqueId(Integer boutiqueId,Integer storeId);

    @Query("SELECT a FROM  CustomCarConfigureDetailModel a  where a.storeId=?1 and a.status=?2")
    List<CustomCarConfigureDetailModel> findMarketByVin(Integer storeId, Integer status);
}
